/**
 * Created by weiwei on 2017/3/2.
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    TouchableOpacity
} from 'react-native';
var LazyJoinCell = React.createClass({
    getDefaultProps(){
        return {
            title:'',
            leftTitle:'',
            leftIcon:true,
            rightTemp:''
        }
    },
    render() {
        var leftIcon =  this.props.leftIcon;
        var cellMargin = leftIcon?5:17;
        return (
            <TouchableOpacity activeOpacity={0.5}>
            <View style={styles.container}>
                {/*左边*/}
                <Text style={styles.cellTextStyle}>{this.props.title}</Text>
                {/*右边*/}
                <View style={{flexDirection:'row',alignItems:'center',}}>
                    {this.props.rightTemp?this.props.rightTemp:null}
                    <Text style={[styles.cellTextStyle,{marginRight:cellMargin}]}>{this.props.leftTitle}</Text>
                    {
                        leftIcon?<Image source={{uri:'right-arrow'}} style={{width:12,height:20}}/>:null
                    }
                </View>
            </View>
            </TouchableOpacity>
        );
    }
});
const styles = StyleSheet.create({
    container: {
        flex: 1,
        height:40,
        marginBottom:1,
        flexDirection:'row',
        alignItems:'center',
        paddingLeft:10,
        paddingRight:10,
        justifyContent:'space-between',
        backgroundColor: '#ffffff',
    },
    cellTextStyle:{
        color:'#b4c5d3'
    }
});
module.exports = LazyJoinCell;